﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 练习6
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("请输入一个正整数");
            int Input1 = Convert.ToInt32(Console.ReadLine());
            Console.Write("请输入第二个正整数");
            int Input2 = Convert.ToInt32(Console.ReadLine());
            for (int i = Math.Min(Input1,Input2); i > 0; i--)
            {
                if (Input1%i==0 && Input2%i==0)
                {
                    Console.WriteLine("最大公约数为{0}", i);
                    break;
                }
            }
            Console.ReadKey();
        }
    }
}
